import { createRouter, createWebHistory } from 'vue-router'
import Layout from '@/views/Layout.vue'
import Home from '@/views/Home/index.vue'
import Category from '@/views/Category/index.vue'
import Cart from '@/views/Cart/index.vue'
import My from '@/views/My/index.vue' 
import Checkcart from '@/views/Cart/checkCart.vue'

const router = createRouter({
	history: createWebHistory(import.meta.env.BASE_URL),
	routes: [
		{
			path: '/',
			name: 'layout',
			component: Layout,
			redirect: '/home',
			children: [
				{
					path: '/home',
					name: 'home',
					component: Home,
				},
				{
					path: '/category',
					name: 'category',
					component: Category,
				},
				{
					path: '/cart',
					name: 'cart',
					component: Cart,
				},
				{
					path: '/my',
					name: 'my',
					component: My,
				},
				{
					path: '/checkcart',
					name: 'checkcart',
					component: Checkcart,
				},
				
				
			],
		},
		{
			path: '/detail/:id',
			name: 'detail',
			component: () => import('@/views/Detail/index.vue')
		},
		{
			path: '/city',
			name: 'city',
		   component:() => import('@/views/Home/location.vue'),
		},
		{
			path: '/login',
			name: 'login',
			component: () => import('@/views/Login/index.vue')
		},
		{
			path: '/signin',
			name: 'signin',
			component: () => import('@/views/Login/signin.vue')
		},
		{
			path: '/search',
			name: 'search',
			component: () => import('@/views/Search/index.vue')
		},
		{
			path: '/order',
			name: 'order',
			component: () => import('@/views/My/order.vue')
		},
		{
			path: '/coupon',
			name: 'coupon',
			component: () => import('@/views/My/coupon.vue')
		},
		{
			path: '/see',
			name: 'see',
			component: () => import('@/views/My/see.vue')
		},
		{
			path: '/evaluate',
			name: 'evaluate',
			component: () => import('@/views/My/evaluate.vue')
		},
	],
})

export default router
